package test;
public class Rectangle {
private double width = 1.0;
private double height = 1.0;
Rectangle() {}
Rectangle(double width, double height) {
this.width = width;
this.height = height;
}
public double getPerimeter() {
return 2 * (width + height);
}
public double getArea() {
return width * height;
}
public String toString() {
return "Rectangle's Information [ width:" + width +", height:" +height + " Perimeter:" + getPerimeter() + ", Area:" + getArea();
}
public static void main(String argv[]) {
Rectangle r1 = new Rectangle(4, 40);
Rectangle r2 = new Rectangle(3.5, 35.9);
System.out.println(r1);
System.out.println(r2);
}
}